import request from "@/utils/request";

export function queryCulture({currentPage, pageSize, description}) {
    return request({
        url: '/front/culture/community',
        method: 'GET',
        params: {
            currentPage: currentPage,
            pageSize: pageSize,
            description: description
        }
    })
}

export function queryCultureCategory() {
    return request({
        url: '/front/culture/community/queryCultureCategory',
        method: 'GET'
    })
}

export function queryCultureById(data) {
    return request({
        url: `/front/culture/community/${data}`,
        method: 'GET'
    })
}

export function queryLeaveMessage({currentPage, pageSize, description}) {
    return request({
        url: '/front/culture/community/query/LeaveMessage',
        method: 'GET',
        params: {
            currentPage: currentPage,
            pageSize: pageSize,
            description: description
        }
    })
}

export function submitLeaveMessage(data) {
    return request({
        url: '/front/culture/community/submit/LeaveMessage',
        method: 'POST',
        data: data
    })
}

export function submitComment(data) {
    return request({
        url: '/front/culture/community/submit/comment',
        method: 'POST',
        data: data
    })
}

export function removeComments(data) {
    return request({
        url: `/front/culture/community/delete/comment/${data}`,
        method: 'DELETE'
    })
}

export function getCommentsByCultureId({currentPage, pageSize, CultureId}) {
    return request({
        url: '/front/culture/community/query/comment',
        method: 'GET',
        params: {
            currentPage: currentPage,
            pageSize: pageSize,
            CultureId: CultureId
        }
    })
}

export function updateLike({commentId, likes}) {
    return request({
        url: `/front/culture/community/update/likes/${commentId}/${likes}`,
        method: 'GET'
    })
}

export function updateTread({commentId, treader}) {
    return request({
        url: `/front/culture/community/update/tread/${commentId}/${treader}`,
        method: 'GET'
    })
}

export function getCommentsMaxLikes(CultureId) {
    return request({
        url: `/front/culture/community/query/comment/maxLikes/${CultureId}`,
        method: 'GET'
    })
}
